\documentclass{article}
% translate with >> pdflatex -shell-escape <file>

% This file is used as unit test for pgfplots, copyright by Christian Feuersaenger.
% 
% See
%   http://pgfplots.sourceforge.net/pgfplots.pdf
% for pgfplots.
%
% Any required input files (for <plot table> or <plot file> or the table package) can be downloaded
% at
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/
% and
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/plotdata/

\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\pagestyle{empty}

\begin{document}
\begin{tikzpicture}[mark size=1.5pt]
\begin{pgfinterruptboundingbox}
\begin{axis}[
  name=hans example,
  xmin=-5,xmax=5,
  xlabel={arc length distance $t$ from saddle [pixels]},
  ylabel={boundary indicator value $|\vec{b}_g(t)|$}]

\addplot file {plotdata/valueplot-flowlines_1.dat};
\addlegendentry{undesired, noise-induced edge}

\addplot[mark=|,red] file {plotdata/valueplot-flowlines_2.dat};
\addlegendentry{real, high-contrast image edge}

\addplot file {plotdata/valueplot-flowlines_3.dat};
\addlegendentry{real, low-contrast image edge}

\addplot file {plotdata/valueplot-flowlines_4.dat};
\addlegendentry{streamer (converging to real edges)}

\draw[dotted] (axis cs:0,0) -- (axis cs:0,14) node[right] {saddle pos};

\end{axis}
\end{pgfinterruptboundingbox}

\useasboundingbox (hans example.below south west) (hans example.above north east);
\end{tikzpicture}
\end{document}
